package org.bozo.im.service.protocols.xmpp.stanza.task;

import org.bozo.im.service.protocols.xmpp.XMPPSession;

public abstract class Task {

	private String mId;
	
	public abstract void doTask(XMPPSession pSession, StringBuilder pBuilder) throws Exception;

	public Task(String pId) {
		mId = pId;
	}

	public boolean isUnique() {
		return false;
	}
	
	public final String getId() {
		return mId;
	}
	
	@Override
	public final boolean equals(Object pObj) {
		return (pObj instanceof Task
				&& pObj.getClass().equals(this.getClass())
				&& mId == ((Task)pObj).mId);
	}
	
	@Override
	public final int hashCode() {
		return this.getClass().hashCode();
	}
}
